-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isNewRequest 메서드를 json 직렬화 대상에서 제외 #739
isNewRequest 메서드를 json 직렬화 대상에서 제외 #739
Conversation
Walkthrough이 변경 사항은 Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@@ -41,6 +42,7 @@ public TempTalkPick toEntity(Member member) { | |||
.build(); | |||
} | |||
|
|||
@JsonIgnore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
매우 킹따봉 유용한 어노테이션이죠~ 👍
Quality Gate passedIssues Measures |
💡 작업 내용
💡 자세한 설명
Spring이 json 처리에 사용하는 Jackson 라이브러리는 직렬화/역직렬화 과정에서 getter/setter를 사용합니다.
(이는 DTO에 getter가 있어야 하는 이유이기도 합니다.)
여기서 중요한 점은, boolean 타입의 경우 jackson은
is~
메서드를 getter로 판단한다는 것입니다.즉, swagger 요청 body에 newRequest가 나타난 이유는 jackson이 isNewRequest 메서드를 getter로 인식해서 직렬화에 포함시켰기 때문입니다.
따라서 isNewRequest 메서드에
@JsonIgnore
어노테이션을 추가하여 직렬화/역직렬화 대상에서 제외했습니다.✅ 셀프 체크리스트
closes #726
Summary by CodeRabbit
isNewRequest
메서드에@JsonIgnore
주석 추가로 JSON 직렬화 및 역직렬화 시 해당 메서드가 무시됩니다.